﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Hyt.Passport;
using Hyt.Web;
using Huayuan.ApplicationService;
using Hyt.Passport.Models;

namespace Huayuan.Manage.Common
{
    public class WebUnitOfWork : HttpContextUnitOfWork<Administrator>
    {
        public WebUnitOfWork()
            : base(HttpContext.Current)
        {
        }

        public WebUnitOfWork(bool usetrnas)
            : base(HttpContext.Current, usetrnas)
        {
        }

        protected override void Init()
        {
            this.SetIocSetting(new IocSetting());
            base.Init();
        }

        private ServiceCenter _serviceCenter;
        public ServiceCenter ServiceCenter
        {
            get
            {
                if (_serviceCenter == null)
                {
                    _serviceCenter = this.Get<ServiceCenter>();
                }
                return _serviceCenter;
            }
        }
    }
}